@page "/setting"
@using BootBlazor.Servers.Auth
@using BootBlazor.Servers.Helper
@using BootBlazor.Servers.Data
@using BootBlazor.Servers.Services

@rendermode RenderMode.InteractiveServer
@attribute [StreamRendering]

<div class="d-flex flex-column" style="height:100%;">
    <PageHeader Title=@_loc["SystemSettingTitle"] UseGrid="false">
    </PageHeader>
    <MudPaper class="flex-1 d-flex" style="overflow:auto;">

        <div class="flex-none" style="width:200px;overflow:auto;">
            <MudList T="SettingModel" ReadOnly="false" @bind-SelectedValue="SelectedValue">
                @foreach (var group in SettingGroups)
                {
                    <MudListItem Value="@group">
                        <div class="d-flex">
                            <MudIcon Icon="@group.Icon" Class="mr-2"></MudIcon>
                            <MudText>
                                @group.Name
                            </MudText>
                        </div>
                    </MudListItem>
                }
            </MudList>
        </div>
        <MudDivider Vertical="true" Class="flex-none" />
        <div class="flex-1 mx-2">
            <DynamicComponent Type="@SettingComDic[SelectedValue?.Name.ToString()!]" />
        </div>
    </MudPaper>
</div>
